// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial

TestCase := Rectangle {
    width: 400phx;
    height: 400phx;
    forward-focus: focus-scope;

    focus-scope := FocusScope {}

    FocusScope {
        focus-changed-event => {
            scope-focused = self.has-focus;
        }
    }

    property <bool> scope-focused;
}

/*
```rust
let instance = TestCase::new().unwrap();
assert!(!instance.get_scope_focused());
slint_testing::send_keyboard_string_sequence(&instance, "\t");
assert!(instance.get_scope_focused());
slint_testing::send_keyboard_string_sequence(&instance, "\t");
assert!(!instance.get_scope_focused());
```

```cpp
auto handle = TestCase::create();
const TestCase &instance = *handle;
assert(!instance.get_scope_focused());
slint_testing::send_keyboard_string_sequence(&instance, "\t");
assert(instance.get_scope_focused());
slint_testing::send_keyboard_string_sequence(&instance, "\t");
assert(!instance.get_scope_focused());
```

```js
var instance = new slint.TestCase();
assert(!instance.scope_focused);
slintlib.private_api.send_keyboard_string_sequence(instance, "\t");
assert(instance.scope_focused);
slintlib.private_api.send_keyboard_string_sequence(instance, "\t");
assert(!instance.scope_focused);
```
*/
